package cn.topcodes.tcsf.admin.commons.api.other;

import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.core.convert.converter.Converter;

public class StringEscapeConverter implements Converter<String,String> {

    @Override
    public String convert(String text) {
        if (text == null) {
            return null;
        }
        text = text.trim();
        return StringEscapeUtils.escapeHtml4(text);
    }
}